import request from '@/utils/request'

export function listServe(data) {
  return request({
    url: '/iam/v1/serves',
    method: 'post',
    data
  })
}

export function searchServe(data) {
  return request({
    url: '/iam/v1/serve/search',
    method: 'post',
    data
  })
}

export function selectServe() {
  return request({
    url: '/iam/v1/serve/selectList',
    method: 'get'
  })
}

export function createServe(data) {
  return request({
    url: '/iam/v1/serve',
    method: 'post',
    data
  })
}

export function editServe(id, data) {
  return request({
    url: '/iam/v1/serve/' + id,
    method: 'put',
    data
  })
}

export function deleteServe(id) {
  return request({
    url: '/iam/v1/serve/' + id,
    method: 'delete'
  })
}

export function openServe(id, domainId, data) {
  return request({
    url: '/iam/v1/serve/' + id + '/' + domainId + '/open',
    method: 'put',
    data
  })
}

export function closeServe(id, domainId, data) {
  return request({
    url: '/iam/v1/serve/' + id + '/' + domainId + '/close',
    method: 'put',
    data
  })
}

export function orgListServe(id, data) {
  return request({
    url: '/iam/v1/serve/' + id + '/domains',
    method: 'post',
    data
  })
}

// /rest/gwm/v1/bi/{chartid}  统计查询
export function chartIdResList(data) {
  return request({
    url: `/gwm/v1/bi/data`,
    method: 'post',
    data
  })
}
